	@include("user.head")
	<!-- 公共头部 -->
	<div id="content_person">
	<div class="row">
		<div class="col-xs-3">
			@include("user.uc.navigation")
		</div>
		<div class="col-xs-9">
			<div class="panel panel-default">
			    <div class="panel-heading">
		   	 		<h3 class="panel-title">项目编辑</h3>
		  		</div>
				<div class="panel-body">
					<div class="form-horizontal">

						<div class="form-group">
						  <label class="col-xs-3 control-label no_padding_right">选择执行方:</label>
						  <div class="col-xs-6">
						    <select class="form-control input_size" name="bidding_group">
						    	<option value="">请选择</option>
						    	@foreach($bidding as $value)
						    	<option value="<%$value['id']%>"><%$value['userData']['company_name']%></option>
						    	@endforeach
						    </select>
						  </div>
						</div>

					    <div class="form-group">
					      <label class="col-xs-3 control-label no_padding_right">项目名称:</label>
					      <div class="col-xs-6">
					        <input class="form-control input_size"  name="name" placeholder="" type="text">
					      </div>
					    </div>

					    <div class="form-group">
					      <label class="col-xs-3 control-label no_padding_right">投资规模(万元):</label>
					      <div class="col-xs-6">
					        <input class="form-control input_size"  name="investment_scale" placeholder="" type="text">
					      </div>
					    </div>


					    <div class="form-group">
					      <label class="col-xs-3 control-label no_padding_right">投资模式:</label>
					      <div class="col-xs-6">
					        <select class="form-control input_size" name="investment_type_id">
					          <option value="">请选择</option>
					          @foreach($investmentType as $value)
					          <option value="<%$value['id']%>"><%$value['name']%></option>
					          @endforeach
					        </select>
					      </div>
					    </div>

					    <div class="form-group">
					      <label class="col-xs-3 control-label no_padding_right">节能效率:</label>
					      <div class="col-xs-6">
					        <input class="form-control input_size" name="efficiency" autocomplete="of" placeholder="" type="text">
					      </div>
					    </div>

					    <div class="form-group">
					      <label class="col-xs-3 control-label no_padding_right">项目启动时间:</label>
					      <div class="col-xs-6">
					        <input class="form-control input_size date-time-picker" readonly name="start_time" autocomplete="of" placeholder="" type="text">
					      </div>
					    </div>

					    <div class="form-group">
					      <label class="col-xs-3 control-label no_padding_right">项目结束时间:</label>
					      <div class="col-xs-6">
					        <input class="form-control input_size date-time-picker" readonly name="end_time" autocomplete="of" placeholder="" type="text">
					      </div>
					    </div>

					    <div class="form-group">
					      <label class="col-xs-3 control-label no_padding_right">省:</label>
					      <div class="col-xs-6">
					      	<select class="form-control fl" name="province" style="float: left; width:300px;" id="province">
					      	  <option value="-1">请选择</option>
					      	  @foreach($province as $value)
					      	  <option value="<%$value['area_id']%>"><%$value['area_name']%></option>
					      	  @endforeach
					      	</select>
					      </div>
					    </div>

					    <div class="form-group">
					      <label class="col-xs-3 control-label no_padding_right">市:</label>
					      <div class="col-xs-6">
					      	<select class="form-control fl" name="city" style="float: left; width:300px;" id="city">
					      	  <option value="-1">请选择</option>
					      	  @foreach($city as $value)
					      	  <option value="<%$value['area_id']%>"><%$value['area_name']%></option>
					      	  @endforeach
					      	</select>
					      </div>
					    </div>

					    <div class="form-group">
					      <label class="col-xs-3 control-label no_padding_right">区:</label>
					      <div class="col-xs-6">
					      	<select class="form-control fl" name="area" style="float: left; width:300px;" id="area">
					      	  <option value="-1">请选择</option>
					      	  @foreach($area as $value)
					      	  <option value="<%$value['area_id']%>"><%$value['area_name']%></option>
					      	  @endforeach
					      	</select>
					      </div>
					    </div>



						<div class="form-group">
						  <label class="col-xs-3 control-label no_padding_right">详细地址:</label>
						  <div class="col-xs-6">
						    <input class="form-control input_size" name="address" autocomplete="of" placeholder="" type="text">
						  </div>
						</div>

					    <div class="form-group">
					      <label class="col-xs-3 control-label no_padding_right">是否申请奖励:</label>
					      <div class="col-xs-6">
					        <div class="radio">
					          <label>
					            <input name="is_request_award" id="" value="0" checked="" type="radio">
					            否
					          </label>
					          <label>
					            <input name="is_request_award" id="" value="1" type="radio">
					            是
					          </label>
					        </div>
					      </div>
					    </div>

					    <div class="form-group">
					      <label class="col-xs-3 control-label no_padding_right">是否申请补贴:</label>
					      <div class="col-xs-6">
					        <div class="radio">
					          <label>
					            <input name="is_request_subsidy" id="" value="0" checked="" type="radio">
					            否
					          </label>
					          <label>
					            <input name="is_request_subsidy" id="" value="1" type="radio">
					            是
					          </label>
					        </div>
					      </div>
					    </div>

					    <div class="form-group">
					      <label class="col-xs-3 control-label no_padding_right">是否申请退税:</label>
					      <div class="col-xs-6">
					        <div class="radio">
					          <label>
					            <input name="is_request_rebate" id="" value="0" checked="" type="radio">
					            否
					          </label>
					          <label>
					            <input name="is_request_rebate" id="" value="1" type="radio">
					            是
					          </label>
					        </div>
					      </div>
					    </div>

					    <div class="form-group">
					      <label class="col-xs-3 control-label no_padding_right">项目图片:</label>
					      <div class="col-xs-6">
					        <a href="javascript:;" class="file btn btn-primary">上传
					            <input type="file" name="imgFile" id="projectImg">
					            <input type="hidden" class="hiddenName" name="image">
					        </a><span class="fileName"></span>
					      </div>
					    </div>

					    <div class="form-group">
					      <label class="col-xs-3 control-label no_padding_right">应用主体:</label>
					      <div class="col-xs-6">
					        <select class="form-control input_size" name="mb_id" id="mbList">
					        	<option value="">请选择</option>
					        	@foreach($mainBody as $value)
					        	<option value="<%$value['id']%>"><%$value['name']%></option>
					        	@endforeach
					        </select>
					      </div>
					    </div>

					    @foreach ($data['project_domain'] as $key => $value)
					    <div class="form-group domainGroup">
					      <label class="col-xs-3 control-label no_padding_right">@if ($key == 0) 应用领域: @endif</label>
					      <div class="col-xs-3" did="<%$value['domain']['parent_id']%>"  cid="<%$value['domain']['id']%>">
					        <select class="form-control input_size app_domain">
					        	<option value="">请选择</option>
					        	@foreach ($domains as $v)
					        	<option value="<%$v['id']%>"><%$v['cate_name']%></option>
					        	@endforeach
					        </select>
					      </div>
					      <div class="col-xs-3">
					        <select class="form-control input_size child_domain">
					        </select>
					      </div>   
					      <div class="col-xs-2 no_padding_both">
					      	@if ($key == 0)
					      	<button class="btn btn-primary" id="addDomain">添加</button>
					      	@else
					      	<button class="btn btn-warning deleteDomain">删除</button>
					      	@endif
					      </div>
					    </div>
					    @endforeach

					    @if($data['project_tech'])
						@foreach($data['project_tech'] as $key=>$value)
					    <div class="form-group saveTechGroup">
					      <label class="col-xs-3 control-label no_padding_right">@if($key == 0)节能技术:@endif</label>
					      <div class="col-xs-6">
					        <select class="form-control input_size save_tech">
					        	@foreach ($techs as $v)
					        	<option value="<%$v['id']%>"><%$v['cate_name']%></option>
					        	@endforeach
					        </select>
					      </div>
					      <div class="col-xs-3 no_padding_both">
					      	@if($key == 0)
					      	<button class="btn btn-primary" id="addTech">添加</button>
					      	@else
							<button class="btn btn-warning deleteTech">删除</button>
					      	@endif
					      </div>
					    </div>
					    @endforeach
					    @else
					    <div class="form-group saveTechGroup">
					      <label class="col-xs-3 control-label no_padding_right">节能技术:</label>
					      <div class="col-xs-6">
					        <select class="form-control input_size save_tech">
					        	@foreach ($techs as $v)
					        	<option value="<%$v['id']%>"><%$v['cate_name']%></option>
					        	@endforeach
					        </select>
					      </div>
					      <div class="col-xs-3 no_padding_both">
					      	<button class="btn btn-primary" id="addTech">添加</button>
					      </div>
					    </div>
					    @endif

					    @if($project_device)
						@foreach($project_device as $key => $value)
					    <div class="form-group saveDevice">
					      <label class="col-xs-3 control-label no_padding_right">@if($key == 0)使用的设备:@endif</label>
					      <div class="col-xs-6">
					        <select class="form-control input_size save_device">
					        	<option value="">请选择</option>
					        	@foreach($device as $v)
					        	<option value="<%$v['id']%>"><%$v['name']%></option>
					        	@endforeach

					        </select>
					      </div>
					      <div class="col-xs-3 no_padding_both">
					      	@if($key == 0)
					      	<button class="btn btn-primary" id="addDevice">添加</button>
					      	@else
					      	<button class="btn btn-warning deleteUseDevice">删除</button>
					      	@endif
					      </div>
					    </div>
					    @endforeach
					    @else
					    <div class="form-group saveDevice">
					      <label class="col-xs-3 control-label no_padding_right">使用的设备:</label>
					      <div class="col-xs-6">
					        <select class="form-control input_size save_device">
					        	<option value="">请选择</option>
					        	@foreach($device as $v)
					        	<option value="<%$v['id']%>"><%$v['name']%></option>
					        	@endforeach
					        </select>
					      </div>
					      <div class="col-xs-3 no_padding_both">
					      	<button class="btn btn-primary" id="addDevice">添加</button>
					      </div>
					    </div>
					    @endif

					    @if($project_tech)
						@foreach($project_tech as $key => $value)
					    <div class="form-group saveUseTech">
					      <label class="col-xs-3 control-label no_padding_right">@if($key == 0)使用的技术:@endif</label>
					      <div class="col-xs-6">
					        <select class="form-control input_size save_use_device">
					        	<option value="">请选择</option>
					        	@foreach($technology as $v)
					        	<option value="<%$v['id']%>"><%$v['tech_name']%></option>
					        	@endforeach
					        </select>
					      </div>
					      <div class="col-xs-3 no_padding_both">
					      	@if($key == 0)
					      	<button class="btn btn-primary" id="addTechnology">添加</button>
					      	@else
					      	<button class="btn btn-warning deleteUseTech">删除</button>
					      	@endif
					      </div>
					    </div>
					    @endforeach
					    @else
					    <div class="form-group saveUseTech">
					      <label class="col-xs-3 control-label no_padding_right">使用的技术:</label>
					      <div class="col-xs-6">
					        <select class="form-control input_size save_use_device">
					        	<option value="">请选择</option>
					        	@foreach($technology as $v)
					        	<option value="<%$v['id']%>"><%$v['tech_name']%></option>
					        	@endforeach
					        </select>
					      </div>
					      <div class="col-xs-3 no_padding_both">
					      	<button class="btn btn-primary" id="addTechnology">添加</button>
					      </div>
					    </div>
					    @endif

					    <div class="form-group">
				          <label for="saveRequire" class="col-xs-3 control-label no_padding_right">节能需求:</label>
				          <div class="col-xs-6">
				            <textarea class="form-control text_size" name="save_require" rows="3" id="saveRequire"></textarea>
				            <span class="help-block"></span>
				          </div>
				        </div>

				    	<div class="form-group">
				          <label for="textArea" class="col-xs-3 control-label no_padding_right">项目简介:</label>
				          <div class="col-xs-6">
				            <textarea class="form-control text_size" name="description" rows="3" id="textArea"></textarea>
				            <span class="help-block"></span>
				          </div>
				        </div>

					    <div class="form-group">
					      <label class="col-xs-3 control-label no_padding_right">项目主要内容:</label>
					      <div class="col-xs-9">
					      	<div id="container" style="height:500px;"></div>
					      </div>
					    </div>

					    <div class="form-group">
					      <div class="col-xs-12 text-center">
					        <button type="button" id="sub" class="btn btn-primary"> 提 交 </button>
					      </div>
					    </div>
				    </div>
				</div>
			</div>
		</div>
	</div>
	</div>
	<!-- 公共底部 -->
	@include("user.footer")
	@include("user.common")
</body>

<script type="text/html" id="domainTemp">
<option value="-1">请选择</option>
{%each list as value}
<option value="{%value.id}">{%value.cate_name}</option>
{%/each}
</script>

<script type="text/html" id="domainSelectTemp">
	<div class="form-group domainGroup">
	  <label class="col-xs-3 control-label no_padding_right"></label>
	  <div class="col-xs-3">
	    <select class="form-control input_size app_domain"></select>
	  </div>
	  <div class="col-xs-3 hide">
	    <select class="form-control input_size child_domain"></select>
	  </div>
	  <div class="col-xs-3 no_padding_both">
	  	<button class="btn btn-warning deleteDomain">删除</button>
	  </div>
	</div>
</script>

<script type="text/html" id="saveTechTemp">
	<div class="form-group saveTechGroup">
      <label class="col-xs-3 control-label no_padding_right"></label>
      <div class="col-xs-6">
        <select class="form-control input_size save_tech">
        </select>
      </div>
      <div class="col-xs-3 no_padding_both">
      	<button class="btn btn-warning deleteTech">删除</button>
      </div>
    </div>
</script>

<script type="text/html" id="useDevice">
<div class="form-group saveDevice">
  <label class="col-xs-3 control-label no_padding_right"></label>
  <div class="col-xs-6">
    <select class="form-control input_size save_device"></select>
  </div>
  <div class="col-xs-3 no_padding_both">
  	<button class="btn btn-warning deleteUseDevice">删除</button>
  </div>
</div>
</script>
<script type="text/html" id="deviceTemp">
<option value="">请选择</option>
{%each list as value}
<option value="{%value.id}">{%value.name}</option>
{%/each}
</script>

<script type="text/html" id="useTech">
<div class="form-group saveUseTech">
  <label class="col-xs-3 control-label no_padding_right"></label>
  <div class="col-xs-6">
    <select class="form-control input_size save_use_device"></select>
  </div>
  <div class="col-xs-3 no_padding_both">
  	<button class="btn btn-warning deleteUseTech">删除</button>
  </div>
</div>
</script>

<script type="text/html" id="techTemp">
<option value="">请选择</option>
{%each list as value}
<option value="{%value.id}">{%value.tech_name}</option>
{%/each}
</script>


<script type="text/javascript">
var ue = UE.getEditor('container');
var pid = "<%input::get('pid')%>";
var que = "que";

var dids = [];
var curDidIndex = 0;

$(".domainGroup").each(function(index, item){
	var node = $(item).children("div.col-xs-3")[0];
	dids.push($(node).attr("did"));
});

renderChildDomain();

function renderChildDomain()
{
	if(curDidIndex >= dids.length){
		return;
	}
	$.getq(que, '<%url("uc")%>/' + "get_domains?parent_id=" + dids[curDidIndex], function(data){
		if(data.success){
			var html = template("domainTemp", {list: data.data});
			var node = $("div[did='" + dids[curDidIndex] + "']");
			var selectNode = node.next().children("select");
			selectNode.html(html);
			selectNode.val(node.attr("cid"));
			curDidIndex++;
			renderChildDomain();
		}
	});
}

$.get("edit_project/detail", {pid : pid}, function (data){
	if(data.success)
	{
		$("input[name='name']").val(data.data.name);
		$("input[name='investment_scale']").val(data.data.investment_scale);
		$("input[name='efficiency']").val(data.data.efficiency);
		$("input[name='start_time']").val(data.data.start_time);
		$("input[name='end_time']").val(data.data.end_time);
		$("input[name='address']").val(data.data.address);
		$("input[name='image']").val(data.data.image);
		$("textarea[name='save_require']").val(data.data.save_require);
		$("textarea[name='description']").val(data.data.description);
		ue.ready(function(){
		    ue.setContent(decodeURIComponent(data.data.content));
		});
		$("select[name='investment_type_id']").val(data.data.investment_type_id);
		$("select[name='province']").val(data.data.province);
		$("select[name='city']").val(data.data.city);
		$("select[name='area']").val(data.data.area);
		$("select[name='mb_id']").val(data.data.main_body[0].mb_id);
		$("input[name='is_request_award']").each(function(k, v){
			if($(this).val() == data.data.is_request_award){
				$(this).attr("checked", "checked");
			}
		})
		$("input[name='is_request_subsidy']").each(function(k, v){
			if($(this).val() == data.data.is_request_subsidy){
				$(this).attr("checked", "checked");
			}
		})

		$("input[name='is_request_rebate']").each(function(k, v){
			if($(this).val() == data.data.is_request_rebate){
				$(this).attr("checked", "checked");
			}
		})

		$.each(data.data.project_tech, function(k, v){
			$(".save_tech").eq(k).val(v.cate_id);
		})

		$.each(data.data.project_domain, function(k, v){
			var node = $(".app_domain").eq(k);
			node.val(node.parent().attr("did"));
			var childNode = node.parent().next().children("select");
			childNode.val(node.parent().attr("cid"));
		});
		$.each(data.data.devices, function(k, v){
			$(".save_device").eq(k).val(v.device_id);
		})

		$.each(data.data.technologies, function(k, v){
			$(".save_use_device").eq(k).val(v.tech_id);
		})


		$("select[name='bidding_group']").val(data.data.biddings.id);

	}
	else
	{
		window.location.href="add_project";
	}
})

var device;
$.getq(que, "<%url('uc/get_use_device')%>", function (data){
	if(data.success && data.data.length){
		device = data.data;
	}
})

$("#addDevice").bind("click", function(){
	var html = template("useDevice", {});
	$(html).insertAfter($(".saveDevice").last());
	var html = template('deviceTemp', {list :device});
	$(".save_device").last().html(html);
	$(".deleteUseDevice").unbind("click");
	$(".deleteUseDevice").bind("click", function(){
		$(this).parents(".saveDevice").remove();
	})
})

var technology;
$.getq(que, "<%url('uc/get_use_tech')%>", function (data){
	if(data.success && data.data.length){
		technology = data.data;
	}
})

//添加使用技术
$("#addTechnology").bind("click", function(){
	var html = template("useTech", {});
	$(html).insertAfter($(".saveUseTech").last());
	var html = template("techTemp", {list : technology});
	$(".save_use_device").last().html(html);
	$(".deleteUseTech").unbind("click");
	$(".deleteUseTech").bind("click", function(){
		$(this).parents(".saveUseTech").remove();
	})
})


// 绑定删除技术
$(".deleteTech").bind("click", function(){
	$(this).parents(".saveTechGroup").remove();
})
// 绑定石删除领域
$(".deleteDomain").bind("click", function(){
		$(this).parents(".domainGroup").remove();
	})
$(".deleteUseDevice").bind("click", function(){
		$(this).parents(".saveDevice").remove();
	})
$(".deleteUseTech").bind("click", function(){
		$(this).parents(".saveUseTech").remove();
	})
$('#projectImg').AjaxFileUpload({
	path : "<% url('uc/user/upload') %>",
	onComplete : function(filename){
			$(this).siblings('input[class="hiddenName"]').val(filename.filename);
			$(this).parent(".file").siblings(".fileName").html(filename.filename);
		}
	});

$("#province").change(function(){
	var pid = $(this).val();
	$.ajax({
		url : '<% url("uc/address/getarea") %>',
		type : 'get',
		data : {pid : pid},
		success:function(data){
			var str = '<option value="-1">请选择</option>';
			$.each(data.area,function(k, v){
				str += '<option value="'+v.area_id+'">'+v.area_name+'</option>';
			})
			$("#city").html(str);
			$("#area").html('<option value="-1">请选择</option>');
		}
	})
})

$("#city").change(function(){
	var pid = $(this).val();
	$.ajax({
		url : '<% url("uc/address/getarea") %>',
		type : 'get',
		data : {pid : pid},
		success:function(data){
			var str = '<option value="-1">请选择</option>';
			$.each(data.area,function(k, v){
				str += '<option value="'+v.area_id+'">'+v.area_name+'</option>';
			})
			$("#area").html(str);
		}
	})
});

// 加载技术
function loadTechs(){
	$.ajax({
		url : "<%url('uc/get_techs')%>",
		type: "get",
		success:function(data){
			if(data.success && data.data.length){
				var html = template("domainTemp", {list: data.data});
				$(".save_tech").last().html(html);
			}
		}
	})
}

$("#addTech").bind("click", function(){
	var html = template("saveTechTemp", {});
	$(html).insertAfter($(".saveTechGroup").last());
	loadTechs();
	$(".deleteTech").unbind("click");
	$(".deleteTech").bind("click", function(){
		$(this).parents(".saveTechGroup").remove();
	})
});

var appDomainSelect;
$(".app_domain").bind("change", function(){
	appDomainSelect = $(this);
	$.ajax({
		url : "<%url('uc/get_domains')%>?parent_id=" + $(this).val(),
		type: "get",
		success:function(data){
			if(data.success){
				var html = template("domainTemp", {list: data.data});
				appDomainSelect.parent().next().removeClass("hide");
				appDomainSelect.parent().next().find("select").html(html);
			}
		}
	})
});


$("#addDomain").bind("click", function(){
		var html = template("domainSelectTemp", {});
		$(html).insertAfter($(".domainGroup").last());
		$(".deleteDomain").unbind("click");
		$(".deleteDomain").bind("click", function(){
			$(this).parents(".domainGroup").remove();
		})

		$.getq(que, "<%url('uc/get_domains')%>", function(data){
			if(data.success && data.data.length){
				var html = template("domainTemp", {list: data.data});
				$(".app_domain").last().html(html);
				$(".app_domain").last().bind("change", function(){
				appDomainSelect = $(this);
				$.getq(que, "<%url('uc/get_domains')%>?parent_id=" + $(this).val(), function(data){
						if(data.success && data.data.length){
							var html = template("domainTemp", {list: data.data});
							appDomainSelect.parent().next().removeClass("hide");
							appDomainSelect.parent().next().find("select").html(html);
						}
					});
				});
			}
		});
		// var html = template("domainTemp", {list: []});
		// $(".app_domain").last().html(html);
	});

//选择执行方
var bidding_id;
$("select[name='bidding_group']").change(function(){
	bidding_id = $(this).val();
})

$("#sub").click(function(){
	var name = $("input[name='name']").val().trim();
	var investment_scale = $("input[name='investment_scale']").val().trim();
	var investment_type_id = $("select[name='investment_type_id']").val().trim();
	var efficiency = $("input[name='efficiency']").val().trim();
	var start_time = $("input[name='start_time']").val().trim();
	var end_time = $("input[name='end_time']").val().trim();
	var province = $("select[name='province']").val().trim();
	var city = $("select[name='city']").val().trim();
	var area = $("select[name='area']").val().trim();
	var address = $("input[name='address']").val().trim();
	var is_request_award = $("input[name='is_request_award']:checked").val().trim();
	var is_request_subsidy = $("input[name='is_request_subsidy']:checked").val().trim();
	var is_request_rebate = $("input[name='is_request_rebate']:checked").val().trim();
	var image = $("input[name='image']").val().trim();
	var description = $("textarea[name='description']").val().trim();
	var save_require = $("textarea[name='save_require']").val().trim();
	var content = encodeURIComponent(ue.getContent());
	var mainBody = $("#mbList").val();

	var domains = [];
	$.each($(".app_domain"), function(index, item){
		if($(item).parent().next().hasClass("hide")){
			domains.push($(item).val());
		}else{
			domains.push($(item).parent().next().find("select").val());
		}
	});

	var bool = false;
	$.each(domains, function(index, item){
		if(item == ""){
			warning("", "请选择应用领域！");
			bool = true;
			return true;
		}
	});

	if(bool){
		return;
	}

	var techs = [];
	$.each($(".save_tech"), function(index, item){
		techs.push($(item).val());
	});

	$.each(techs, function(index, item){
		if(item == ""){
			warning("", "请选择节能技术！");
			bool = true;
			return true;
		}
	});

	if(bool){
		return;
	}

	var device = [];
	$.each($(".save_device"), function (index, item){
		if($(item).val()){
			device.push($(item).val());
		}
	})
	if(device.length == 0){
		warning("", "请选择使用的设备");
		return;
	}

	var useTech = [];
	$.each($(".save_use_device"), function (index, item){
		if($(item).val()){
			useTech.push($(item).val());
		}
	})
	if(useTech.length == 0){
		warning("", "请选择使用的技术");
		return;
	}

	if (name == '' || investment_scale == '' || investment_type_id == '' || efficiency == '' || start_time == '' || end_time == '' || province < 1  || city < 1  || address == '' || is_request_award == '' || is_request_subsidy == '' || is_request_rebate == '' || description == '' || content == '' || mainBody == '' || save_require == '')
	{
		warning('','必填信息不能为空');
		return false;
	}

	if(textNum(save_require) >=20){
		warning("", "节能需求只能输入20个字符");
		return ;
	}

	$.post("edit_project/update", {
		name : name,
		investment_scale : investment_scale,
		investment_type_id : investment_type_id,
		efficiency : efficiency,
		end_time : end_time,
		province : province,
		city : city,
		area : area,
		address : address,
		is_request_award : is_request_award,
		is_request_subsidy : is_request_subsidy,
		is_request_rebate : is_request_rebate,
		image : image,
		description : description,
		content : content,
		domains: domains,
		techs: techs,
		main_body: mainBody,
		save_require: save_require,
		start_time: start_time,
		pid: pid,
		bidding_id : bidding_id,
		device : device,
		useTech : useTech
	},function (data){
		if(data.success){
			success("", "提交成功");
			setTimeout(function(){
				window.location.href="project";
			},1000)
		}
	})
})

</script>
</html>